using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace Infragistics.StyleLibrary
{
    public class GetStyleLibrary
    {
        #region Constructor

        public GetStyleLibrary()
        {
            
        }

        #endregion Constructor

        #region Private Members

        private string islFileName = "IG.isl";
        private const string DataRegistryKey = @"Infragistics\NetAdvantage\Net\Full\WinForms\CLR2x\Version" + Infragistics.Shared.AssemblyVersion.MajorMinor + @"\WinDataDir";

        #endregion Private Members
        
        #region styleLibraryPath
        /// <summary>
        /// Path to the Style Library folder installed by the install.
        /// </summary>
        private static string styleLibraryPath
        {
            get
            {
                Microsoft.Win32.RegistryKey dataRegKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(DataRegistryKey);

                string path = null;

                if (dataRegKey != null)
                {
                    path = dataRegKey.GetValue(null) as string + "StyleLibrary";
                    dataRegKey.Close();
                }

                return path;
            }
        }
        #endregion //styleLibraryPath
                
        #region Private Methods

        #region GetIsl

        public string GetIsl()
        {
           return System.IO.Path.Combine(styleLibraryPath, islFileName);
                      
        }

        #endregion GetIsl

         #endregion Private Methods

    }
}
